import { Component, OnInit } from '@angular/core';
import { IonicPage } from 'ionic-angular';
import { DomService } from '../../../services/dom/dom-service';
import { QuestionDataService } from '../../../data/dom/questions';
import { DomFormComponent } from '../../../templates/dom/dom-form';

@IonicPage()
@Component({
  selector: 'page-dom-question',
  templateUrl: '../../../templates/dom/dom-form.html',
  providers: [DomService, QuestionDataService]
})
export class DomQuestionPage extends DomFormComponent {

  constructor(private domService: DomService,
    private qds: QuestionDataService
  ) {
    //调用父类构造函数
    super();
  }

  ngOnInit() {
    this.dombases = this.qds.getDomBases();
    this.form = this.domService.toFormGroup(this.dombases);
  }

  onSubmit() {
    this.payLoad = JSON.stringify(this.form.value) + "123";
  }
}
